package welcome;

import java.awt.Toolkit;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class WelcomeScreen extends JPanel {
	public WelcomeScreen() {
	}
	
	private static JFrame frame = null;
	
	public static JFrame load() {
		/* Frame settings */
		frame = new JFrame();
		frame.setBounds(100, 100, 697, 89);
		frame.setUndecorated(true);
		frame.setTitle("Aspect Library");
		frame.setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\F. OMENA\\Dropbox\\Mestrado\\Projeto-Mestrado\\AspectLibrary\\Images\\logo\\logo3.png"));
		frame.setLocation(
				((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (frame
						.getWidth() / 2)), ((Toolkit.getDefaultToolkit()
						.getScreenSize().height / 2) - (frame.getHeight() / 2)));
		
		/* WelcomeScreen instance */
		WelcomeScreen logo = new WelcomeScreen();
		logo.showLogo();

		/* Add logo on frame */
		frame.getContentPane().add(logo);
		frame.setVisible(true);
		
		return frame;
	}
	
	private void showLogo(){
		setBounds(100, 100, 697, 89);
		
		/* Logo */
		JLabel lblAaa = new JLabel("");
		lblAaa.setIcon(new ImageIcon("C:\\Users\\F. OMENA\\Dropbox\\Mestrado\\Projeto-Mestrado\\AspectLibrary\\Images\\logo\\initial logo4.png"));
		
		/* Layout */
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addComponent(lblAaa, GroupLayout.DEFAULT_SIZE, 710, Short.MAX_VALUE)
					.addGap(18))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addComponent(lblAaa, GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE)
					.addGap(31))
		);
		setLayout(groupLayout);
	}

}
